-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Avoid dropdown resizing because of text #35445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There are more cases in the codebase where empty text is set:
I wonder if a CSS-based solution is possible which would fix all of them, not just this search box. Adding |
I don't think the patch is ideal. Such hacky patches will just cause more problems: for example: it breaks the "small dropdown" layout. |
Ultimately the issue stems from the fact that dropdown height is determined based on the text, and text height is variable with font size and whether text is present or not. I think we may be able to find a better solution that sizes height independent on text, but it will likely limit dropdown text to single-line content (which I think is no issue). |
I guess a devtest page is needed to render dropdowns of various sizes to ensure they all render correctly. I guess with a proper |
Dropdown text is empty when rendering initially which causes the element to resize vertically when the text is set later via JS. Here seen on the global PR list:
Fix this by using a non-breaking space so the element will not resize when it receives the text.